package net.oschina.victor.repsotory;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import net.oschina.victor.entity.User;

@Repository
public interface UserRepsotory extends PagingAndSortingRepository<User, Long>, JpaSpecificationExecutor<User> {
	@Query(value = "select a from User a ,Organization b where a.organizationId=b.id and b.parentIds like '%,' + :id + ',%'")
	public List<User> findUsersByOrganizationId(String id);
}
